#pragma once
#include "DTimer.h"
#include "DCamera.h"
//#include "QUnit.h"
#include "Camera_quat.h"
#include <vector>
#include "ShaderManager.h"

enum EngineCommand
{
	EC_PLAYER_CAMERA_MOVE_FORWARD,
	EC_PLAYER_CAMERA_MOVE_BACK,
	EC_PLAYER_CAMERA_STRAFE_LEFT,
	EC_PLAYER_CAMERA_STRAFE_RIGHT,
	EC_PLAYER_CAMERA_PITCH_DOWN,
	EC_PLAYER_CAMERA_PITCH_UP,
	EC_PLAYER_CAMERA_YAW_LEFT,
	EC_PLAYER_CAMERA_YAW_RIGHT
};

class DEngine
{
	//DTimer m_timer;
	bool bIsActive;
	bool bFullscreen;
	std::vector<EngineCommand> m_AcceptedCommands;

	// SHADERS
	GLuint m_shaderProgram;
	GLuint m_uiShader;
	GLint m_uniform_mvpMatrix;
	GLint m_uniform_texture;

public:
	DCamera gCamera;
	Camera_quat<float> qCamera;
	DTimer m_timer;

	DEngine(void);
	~DEngine(void);

	void Work();
	void Resize(int w, int h);

	void ProcessCommands();
	void SendCommand(EngineCommand com);


	bool Initialize();

	void OnExit();

private:
	void Render();
	bool InitGL();
};